home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / Console.mod < prev    next >
Text File  |  1994-08-08  |  4KB  |  155 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: Console.mod $
  4.   Description: Interface to console.device
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 01:09:48 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. MODULE Console;
  23.  
  24. (*
  25. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  26. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  27. ** $V- OvflChk       $Z- ZeroVars
  28. *)
  29.  
  30. IMPORT
  31.   E := Exec, IE := InputEvent, KM := KeyMap, G := Graphics, SYS := SYSTEM;
  32.  
  33.  
  34. (*
  35. **      $VER: console.h 36.11 (7.11.90)
  36. **
  37. **      Console device command definitions
  38. *)
  39.  
  40. CONST
  41.  
  42. (****** Console commands ******)
  43.   askKeyMap            * = E.cmdNonstd+0;
  44.   setKeyMap            * = E.cmdNonstd+1;
  45.   askDefaultKeyMap     * = E.cmdNonstd+2;
  46.   setDefaultKeyMap     * = E.cmdNonstd+3;
  47.  
  48. (****** SGR parameters ******)
  49.  
  50.   sgrPrimary     * = 0;
  51.   sgrBold        * = 1;
  52.   sgrItalic      * = 3;
  53.   sgrUnderscore  * = 4;
  54.   sgrNegative    * = 7;
  55.  
  56.   sgrNormal      * = 22;      (* default foreground color, not bold *)
  57.   sgrNotItalic   * = 23;
  58.   sgrNotUnderscore * = 24;
  59.   sgrPositive    * = 27;
  60.  
  61. (* these names refer to the ANSI standard, not the implementation *)
  62.   sgrBlack       * = 30;
  63.   sgrRed         * = 31;
  64.   sgrGreen       * = 32;
  65.   sgrYellow      * = 33;
  66.   sgrBlue        * = 34;
  67.   sgrMagenta     * = 35;
  68.   sgrCyan        * = 36;
  69.   sgrWhite       * = 37;
  70.   sgrDefault     * = 39;
  71.  
  72.   sgrBlackBg     * = 40;
  73.   sgrRedBg       * = 41;
  74.   sgrGreenBg     * = 42;
  75.   sgrYellowBg    * = 43;
  76.   sgrBlueBg      * = 44;
  77.   sgrMagentaBg   * = 45;
  78.   sgrCyanBg      * = 46;
  79.   sgrWhiteBg     * = 47;
  80.   sgrDefaultBg   * = 49;
  81.  
  82. (* these names refer to the implementation, they are the preferred *)
  83. (* names for use with the Amiga console device. *)
  84.   sgrClr0        * = 30;
  85.   sgrClr1        * = 31;
  86.   sgrClr2        * = 32;
  87.   sgrClr3        * = 33;
  88.   sgrClr4        * = 34;
  89.   sgrClr5        * = 35;
  90.   sgrClr6        * = 36;
  91.   sgrClr7        * = 37;
  92.  
  93.   sgrClr0Bg      * = 40;
  94.   sgrClr1Bg      * = 41;
  95.   sgrClr2Bg      * = 42;
  96.   sgrClr3Bg      * = 43;
  97.   sgrClr4Bg      * = 44;
  98.   sgrClr5Bg      * = 45;
  99.   sgrClr6Bg      * = 46;
  100.   sgrClr7Bg      * = 47;
  101.  
  102.  
  103. (****** DSR parameters ******)
  104.  
  105.   dsrCpr         * = 6;
  106.  
  107. (****** CTC parameters ******)
  108.   ctcHSetTab     * = 0;
  109.   ctcHClrTab     * = 2;
  110.   ctcHClrTabsAll * = 5;
  111.  
  112. (****** TBC parameters ******)
  113.   tbcHClrTab     * = 0;
  114.   tbcHClrTabsAll * = 3;
  115.  
  116. (****** SM and RM parameters ******)
  117.   mLNM   * = 20;      (* linefeed newline mode *)
  118.   mASM   * = ">1";    (* auto scroll mode *)
  119.   mAWM   * = "?7";    (* auto wrap mode *)
  120.  
  121.  
  122. (**-- Device base variable----------------------------------------------*)
  123.  
  124.  
  125. CONST
  126.  
  127.   name * = "console.device";
  128.  
  129. TYPE
  130.  
  131.   ConsoleBasePtr * = CPOINTER TO ConsoleBase;
  132.   ConsoleBase * = RECORD (E.Device) END;
  133.  
  134.  
  135. (**-- Device functions -------------------------------------------------*)
  136.  
  137. (*
  138. **      $VER: console_protos.h 36.6 (7.11.90)
  139. *)
  140.  
  141. LIBCALL (base : ConsoleBasePtr) CDInputHandler*
  142.   ( events        [8] : IE.InputEventBasePtr;
  143.     consoleDevice [9] : ConsoleBasePtr )
  144.   : IE.InputEventBasePtr;
  145.   -42;
  146. LIBCALL (base : ConsoleBasePtr) RawKeyConvert*
  147.   ( events     [8] : IE.InputEventBasePtr;
  148.     VAR buffer [9] : ARRAY OF SYS.BYTE;
  149.     length     [1] : LONGINT;
  150.     keyMap    [10] : KM.KeyMapPtr )
  151.   : LONGINT;
  152.   -48;
  153.  
  154. END Console.
  155.